$OpenBSD: patch-p11-kit_modules_c,v 1.1 2016/03/06 12:16:26 ajacoutot Exp $

From 6c4ef3f492d88acca931174519b7aa1215cc1a18 Mon Sep 17 00:00:00 2001
From: Pankaj <pankaj.s01@samsung.com>
Date: Tue, 5 Jan 2016 09:52:00 +0000
Subject: Avoiding redundant check

--- p11-kit/modules.c.orig	Wed Oct 21 08:20:53 2015
+++ p11-kit/modules.c	Sat Mar  5 09:57:47 2016
@@ -2326,17 +2326,15 @@ p11_module_load_inlock_reentrant (CK_FUNCTION_LIST *mo
 		}
 
 		/* If this was newly allocated, add it to the list */
-		if (rv == CKR_OK && allocated) {
+		if (allocated) {
 			if (!p11_dict_set (gl.modules, allocated, allocated) ||
 			    !p11_dict_set (gl.unmanaged_by_funcs, module, allocated))
 				return_val_if_reached (CKR_HOST_MEMORY);
 			allocated = NULL;
 		}
 
-		if (rv == CKR_OK) {
 			/* WARNING: Reentrancy can occur here */
 			rv = prepare_module_inlock_reentrant (mod, flags, result);
-		}
 
 		free (allocated);
 	}
